
import {getBaoXiaoList,getApplyList,getLoginList} from '@/apilist/Admin'

const state = {
    baoxiao: {
      list: [],
      total: 0,
      admin_type_list: [],
      state_list: [],
    },
    applyList: [],
    attendList: {
      list: [],
      total: 0,
      staff_list: [],
    },
}

const mutations = {
      getBaoXiaoMutations(state,data){
        state.baoxiao.list = data.data
        state.baoxiao.total = data.total
        state.baoxiao.admin_type_list = data.admin_type_list
        state.baoxiao.state_list = data.state_list
      },
      getApplyListMutations(state,data) {
        state.applyList = data
      },
      getLoginListMutations(state,data){
        state.attendList.list = data.data
        state.attendList.total = data.total
        state.attendList.staff_list = data.staff_list
      },
}

const actions = {

      async getBaoXiaoActions(ctx,data){
        let res = await getBaoXiaoList(data)
        console.log(res.data)
         ctx.commit('getBaoXiaoMutations',res.data)
      },

      async getApplyListActions(ctx,data){
        let res = await getApplyList(data)
        //console.log(res.data)
        ctx.commit('getApplyListMutations',res.data)
      },

  async getLoginListActions(ctx,data){
    let res = await getLoginList(data)
     //console.log(res.data)
    ctx.commit('getLoginListMutations',res.data)
  },
}


export default {
  namespaced: true,
  state,
  mutations,
  actions
}
